<div class="events view">

<span>
		<h2><?= $event['Event']['title'];?></h2>
		
		<span>
			<?= $html->link(__('<< Go to announcement', true), 'main/' . $event['Event']['id'].'/1', null, null, false); ?>
		</span>
	</span>
	<span>
		<h4>
			<?= date('F j, Y', strtotime($event['Event']['start_date'])) . ' to ' . date('F j, Y', strtotime($event['Event']['end_date'])); ?>
			| <?= $eventType['EventType']['title']; ?>
			| <?= $html->link(__($season['Season']['season_name'], true), array('controller'=>'seasons', 'action'=>'view',$event['Event']['id']), null,null, false); ?>
		</h4>
	</span>
	<div id="content_body">
		<?= str_replace("\n", "<br/>", $event['Event']['content_body']); ?>
	</div>

</div>
<?php
	if (!$event['Event']['is_closed']) {
?>
<div class="actions">
	<ul>
		<li><?php echo $html->link(__('Edit Event', true), array('action' => 'edit', $event['Event']['id'])); ?> </li>
	</ul>
</div>
<?php
	}
?>
<hr/>

<div class = "comments">
<?='<h2>Comments</h2>';?>
<?php foreach($comment as $comments) :?>
<?=$html->link($comments['Creator']['username'],'/users/view/'.$comments['Creator']['id'],null,null,false);?>&nbsp;&nbsp;&nbsp;
<?php
	echo '<span id="created_date">' . date('F j, Y, g:i a', strtotime($comments['Comment']['created'])) .'</span>';
?>

	<div class = "comment_content">
	<?=str_replace("\n", "<br/>", $comments['Comment']['content']);?>
	</div>

<div class="actions">
	<ul>
		<li>
			<?php
				if($user_id == $comments['Comment']['user_id'] && !$event['Event']['is_closed'])
					echo $html->link(__('Edit', true),array('controller'=>'comments', 'action'=>'edit', $comments['Comment']['id']) ,null,null,false);
			?>
		</li>
		<li>
			<?php
				if($user_id == $comments['Comment']['user_id'] || $accessArray['DeleteEvent'])
					echo $html->link(__('Delete', true),array('controller'=>'comments', 'action'=>'delete', $comments['Comment']['id'], $event['Event']['id'], 1) ,null,null,false);
			?>
		</li>
		<li>
			<?php
				echo $html->link(__('Report', true),array('controller'=>'comments', 'action'=>'report', $comments['Comment']['id'], $event['Event']['id'], 1) ,null,null,false);
			?>
		</li>
	</ul>
</div>
<hr/>

<? endforeach; ?>
<?php
	if (!$event['Event']['is_closed']) {
		echo $html->link(__('Add new Comment', true), array('controller' => 'comments', 'action' => 'add', $event['Event']['id'], 1), null, null,false);
	}
?>
</div>
